package com.kingdee.openimport.patch_service.service.impl;

import com.kingdee.openimport.patch_service.config.MQConfig;
import com.kingdee.openimport.patch_service.service.IPatchMessageService;
import com.kingdee.openimport.patch_service.vo.PatchMsg;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by Niki on 2018/5/11 10:22
 */
@Service
@Slf4j
public class PatchMessageServiceImpl implements IPatchMessageService {
    @Resource
    RabbitTemplate rabbitTemplate;
    @Override
    public void sendPatchMsg(String msg) {
        if (msg != null) {
            rabbitTemplate.convertAndSend(MQConfig.getExchangeKey(),"", msg);
            log.info("补丁消息：{}，发送成功！", msg);
        }
    }
}
